package com.tedu.day06mybatis.mapper;

import com.tedu.day06mybatis.pojo.Weibo;
import com.tedu.day06mybatis.pojo.WeiboVO1;
import com.tedu.day06mybatis.pojo.WeiboVO2;
import com.tedu.day06mybatis.pojo.WeiboVO3;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface WeiboMapper {

    int insert(Weibo weibo);

    int deleteById(Integer id);

    int updateById(Weibo weibo);

    Weibo findById(Integer id);

    List<Weibo> findAll();

    //@Select("SELECT content,created FROM weibo WHERE id=#{id}")
   // Weibo selectContent(int id);
    WeiboVO1 selectContent(int id);

    //动态SQL
    int dynamicUpdate (Weibo weibo);

    int deleteByIds(int[] id);

    int deleteByIds2(List<Integer> id);

    //SELECT COUNT(*) FROM weibo;
    int selectCount();

    WeiboVO2 selectResultMap(int id);

    WeiboVO3 selectWeiboAndCommentById(int id);


}
